﻿using System.IO;
using System.Net;

namespace H.Sync.Http
{
    internal class HttpServer
    {

        public static void M()
        {
            HttpListener listener = new HttpListener
            {
                AuthenticationSchemes = AuthenticationSchemes.Anonymous
            };
            listener.Prefixes.Add("http://127.0.0.1:4444/");
            listener.Start();

            while (true)
            {
                HttpListenerContext context = listener.GetContext();


                context.Response.StatusCode = 200;
                using (StreamWriter sw = new StreamWriter(context.Response.OutputStream))
                {
                    sw.WriteLine(context.Request.RawUrl);
                }
            }
        }
    }
}
